<%@page import="entity.student"%>
<%@page import="dao.studentDAO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Insert title here</title>
	</head>
	<body>
		<%
			int id = Integer.parseInt(request.getParameter("id"));
			studentDAO studentdao = new studentDAO();
			student stu = studentdao.getStudentById(id);
		%>
		<form action="<%=request.getContextPath()%>/updateServlet" method="post">
			<table border="1">
				<tr>
					<th>编号</th>
					<th>姓名</th>
					<th>性别</th>
					<th>地址</th>
					<th>电话号码</th>
					<th>邮箱</th>
				</tr> 
				<tr>
				<th><input type="text" value="<%=stu.getId() %>" name="id"></th>
				<td><input type="text" value="<%=stu.getName() %>" name="name"></td>
				<td><input type="text" value="<%=stu.getSex() %>" name="sex"></td>
				<td><input type="text" value="<%=stu.getAddress() %>" name="address"></td>
				<td><input type="text" value="<%=stu.getPhone() %>" name="phone"></td>
				<td><input type="text" value="<%=stu.getEmail() %>" name="email"></td>
				</tr>
			</table>
			<input type="submit" value="修改">
		</form>
	</body>
</html>